package com.sc.nft.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.extern.slf4j.Slf4j;
import com.sc.nft.entity.RankingBoardMarketValueAccount;
import com.sc.nft.mapper.RankingBoardMarketValueAccountMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Repository;

/**
 * 排行榜市值账号关联表(sc_ranking_board_market_value_account)数据DAO
 *
 * @author Sun
 * @since 2023-08-09 11:36:53
 * @description 由 Mybatisplus Code Generator 创建
 */
@Slf4j
@Repository
public class RankingBoardMarketValueAccountDao extends ServiceImpl<RankingBoardMarketValueAccountMapper, RankingBoardMarketValueAccount> {

    public Integer getCountByRankingBoardConfIdAndMarketValueAccount(Long rankingBoardConfId, String userTel) {
        LambdaQueryWrapper<RankingBoardMarketValueAccount> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(RankingBoardMarketValueAccount::getRankingBoardConfId, rankingBoardConfId);
        wrapper.eq(RankingBoardMarketValueAccount::getMarketValueAccount, userTel);
        return this.count(wrapper);
    }
}